/**
 * @author		Sergey Suzdalskiy
 * @e-mail:		sergey.suzdalskiy@gmail.com
 */
package ua.kiev.gcore.ui.controls
{
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	import flash.text.TextField;
	

	public class ButtonSelect extends ButtonMovieClip
	{
		private var _selected:Boolean;
		
		public function ButtonSelect(UID:String, BackGround:MovieClip, Label:TextField, textValue:String, MouseClickFunction:Function)
		{
			super(UID, BackGround, Label, textValue, MouseClickFunction);
			Selected = false;
		}
		
		public function set Selected(value:Boolean):void{
			_selected = value;
			if(Selected){
				super.State = BUTTON_DOWN_STATE;
			}else{
				super.State = BUTTON_UP_STATE;
			}
		}
		
		public function get Selected():Boolean{			
			return _selected;
		}
		
		override public function set State(value:int):void{
			if(!Selected){
				super.State = value;
			}
		}
		
	}
}